gen party_age=.c				
replace 	party_age=	1994	 if partyelec_id==	1200701
replace 	party_age=	1901	 if partyelec_id==	1200702
replace 	party_age=	1920	 if partyelec_id==	1200703
replace 	party_age=	1977	 if partyelec_id==	1200704
replace 	party_age=	1992	 if partyelec_id==	1200705
replace 	party_age=	1997	 if partyelec_id==	1200706
replace 	party_age=	2001	 if partyelec_id==	1200707
replace 	party_age=	1988	 if partyelec_id==	1200708
replace 	party_age=	1994	 if partyelec_id==	1201001
replace 	party_age=	1992	 if partyelec_id==	1201002
replace 	party_age=	2008	 if partyelec_id==	1201003
replace 	party_age=	1912	 if partyelec_id==	2200701
replace 	party_age=	1894	 if partyelec_id==	2200702
replace 	party_age=	1971	 if partyelec_id==	2200703
replace 	party_age=	1888	 if partyelec_id==	2200704
replace 	party_age=	1983	 if partyelec_id==	2200705
replace 	party_age=	2004	 if partyelec_id==	2200706
replace 	party_age=	1913	 if partyelec_id==	2200707
replace 	party_age=	1997	 if partyelec_id==	2200708
replace 	party_age=	1919	 if partyelec_id==	2200709
replace 	party_age=	1975	 if partyelec_id==	2200710
replace 	party_age=	1961	 if partyelec_id==	2200711
replace 	party_age=	1991	 if partyelec_id==	2200712
replace 	party_age=	1944	 if partyelec_id==	2200713
replace 	party_age=	1992	 if partyelec_id==	2200714
replace 	party_age=	.c	 if partyelec_id==	2200715
replace 	party_age=	1985	 if partyelec_id==	2200716
replace 	party_age=	.c	 if partyelec_id==	2200720
replace 	party_age=	1894	 if partyelec_id==	2201101
replace 	party_age=	1912	 if partyelec_id==	2201102
replace 	party_age=	1888	 if partyelec_id==	2201103
replace 	party_age=	1971	 if partyelec_id==	2201104
replace 	party_age=	1919	 if partyelec_id==	2201107
replace 	party_age=	1997	 if partyelec_id==	2201108
replace 	party_age=	1944	 if partyelec_id==	2201109
replace 	party_age=	2004	 if partyelec_id==	2201110
replace 	party_age=	2005	 if partyelec_id==	2201111
replace 	party_age=	.c	 if partyelec_id==	2201112
replace 	party_age=	1983	 if partyelec_id==	2201113
replace 	party_age=	1961	 if partyelec_id==	2201115
replace 	party_age=	1975	 if partyelec_id==	2201116
replace 	party_age=	1991	 if partyelec_id==	2201118
replace 	party_age=	2008	 if partyelec_id==	2201119
replace 	party_age=	.c	 if partyelec_id==	2201120
replace 	party_age=	1863	 if partyelec_id==	3200501
replace 	party_age=	1945	 if partyelec_id==	3200502
replace 	party_age=	1948	 if partyelec_id==	3200504
replace 	party_age=	1980	 if partyelec_id==	3200505
replace 	party_age=	1989	 if partyelec_id==	3200506
replace 	party_age=	2004	 if partyelec_id==	3200507
replace 	party_age=	.c	 if partyelec_id==	3200520
replace 	party_age=	.c	 if partyelec_id==	3200597
replace 	party_age=	1863	 if partyelec_id==	3200901
replace 	party_age=	1945	 if partyelec_id==	3200902
replace 	party_age=	1948	 if partyelec_id==	3200904
replace 	party_age=	1980	 if partyelec_id==	3200905
replace 	party_age=	1989	 if partyelec_id==	3200906
replace 	party_age=	.c	 if partyelec_id==	3200920
replace 	party_age=	.c	 if partyelec_id==	3200997
replace 	party_age=	1926	 if partyelec_id==	4200701
replace 	party_age=	1922	 if partyelec_id==	4200702
replace 	party_age=	1981	 if partyelec_id==	4200703
replace 	party_age=	1901	 if partyelec_id==	4200704
replace 	party_age=	1985	 if partyelec_id==	4200705
replace 	party_age=	1905	 if partyelec_id==	4200706
replace 	party_age=	.c	 if partyelec_id==	4200707
replace 	party_age=	1974	 if partyelec_id==	5200701
replace 	party_age=	1974	 if partyelec_id==	5200702
replace 	party_age=	1974	 if partyelec_id==	5200901
replace 	party_age=	1974	 if partyelec_id==	5200902
replace 	party_age=	1974	 if partyelec_id==	5201201
replace 	party_age=	1974	 if partyelec_id==	5201202
replace 	party_age=	2004	 if partyelec_id==	5201203
replace 	party_age=	2012	 if partyelec_id==	5201204
replace 	party_age=	1980	 if partyelec_id==	5201205
replace 	party_age=	2010	 if partyelec_id==	5201206
replace 	party_age=	1918	 if partyelec_id==	6201101
replace 	party_age=	1899	 if partyelec_id==	6201102
replace 	party_age=	1995	 if partyelec_id==	6201103
replace 	party_age=	1906	 if partyelec_id==	6201104
replace 	party_age=	1990	 if partyelec_id==	6201105
replace 	party_age=	1987	 if partyelec_id==	6201106
replace 	party_age=	1958	 if partyelec_id==	6201107
replace 	party_age=	1906	 if partyelec_id==	6201108
replace 	party_age=	2008	 if partyelec_id==	6201109
replace 	party_age=	1984	 if partyelec_id==	6201110
replace 	party_age=	2009	 if partyelec_id==	6201111
replace 	party_age=	.c	 if partyelec_id==	6201112
replace 	party_age=	1994	 if partyelec_id==	6201113
replace 	party_age=	1991	 if partyelec_id==	6201114
replace 	party_age=	1999	 if partyelec_id==	6201115
replace 	party_age=	1988	 if partyelec_id==	6201116
replace 	party_age=	2002	 if partyelec_id==	6201117
replace 	party_age=	.c	 if partyelec_id==	6201120
replace 	party_age=	1978	 if partyelec_id==	7200701
replace 	party_age=	2002	 if partyelec_id==	7200702
replace 	party_age=	2002	 if partyelec_id==	7200703
replace 	party_age=	1980	 if partyelec_id==	7200704
replace 	party_age=	1985	 if partyelec_id==	7200705
replace 	party_age=	2001	 if partyelec_id==	7200711
replace 	party_age=	2001	 if partyelec_id==	7200712
replace 	party_age=	2001	 if partyelec_id==	7200713
replace 	party_age=	1992	 if partyelec_id==	7200715
replace 	party_age=	1978	 if partyelec_id==	7200716
replace 	party_age=	1982	 if partyelec_id==	7200717
replace 	party_age=	2007	 if partyelec_id==	7200718
replace 	party_age=	1978	 if partyelec_id==	7201001
replace 	party_age=	2002	 if partyelec_id==	7201002
replace 	party_age=	2002	 if partyelec_id==	7201003
replace 	party_age=	1980	 if partyelec_id==	7201004
replace 	party_age=	2001	 if partyelec_id==	7201011
replace 	party_age=	2001	 if partyelec_id==	7201012
replace 	party_age=	2001	 if partyelec_id==	7201013
replace 	party_age=	1992	 if partyelec_id==	7201015
replace 	party_age=	1978	 if partyelec_id==	7201016
replace 	party_age=	1982	 if partyelec_id==	7201017
replace 	party_age=	2007	 if partyelec_id==	7201018
replace 	party_age=	2009	 if partyelec_id==	7201019
replace 	party_age=	1980	 if partyelec_id==	8200601
replace 	party_age=	1946	 if partyelec_id==	8200602
replace 	party_age=	1972	 if partyelec_id==	8200603
replace 	party_age=	1948	 if partyelec_id==	8200604
replace 	party_age=	1990	 if partyelec_id==	8200606
replace 	party_age=	2000	 if partyelec_id==	8200607
replace 	party_age=	1966	 if partyelec_id==	8200608
replace 	party_age=	1918	 if partyelec_id==	8200609
replace 	party_age=	1946	 if partyelec_id==	8200610
replace 	party_age=	1999	 if partyelec_id==	10200901
replace 	party_age=	1974	 if partyelec_id==	10200902
replace 	party_age=	1987	 if partyelec_id==	10200903
replace 	party_age=	1974	 if partyelec_id==	10200904
replace 	party_age=	1973	 if partyelec_id==	10200905
replace 	party_age=	1999	 if partyelec_id==	10201101
replace 	party_age=	1974	 if partyelec_id==	10201102
replace 	party_age=	1987	 if partyelec_id==	10201103
replace 	party_age=	1974	 if partyelec_id==	10201105
replace 	party_age=	1973	 if partyelec_id==	10201106
replace 	party_age=	1991	 if partyelec_id==	11201102
replace 	party_age=	1994	 if partyelec_id==	11201103
replace 	party_age=	1994	 if partyelec_id==	11201104
replace 	party_age=	1998	 if partyelec_id==	11201105
replace 	party_age=	2006	 if partyelec_id==	11201106
replace 	party_age=	2006	 if partyelec_id==	11201107
replace 	party_age=	1990	 if partyelec_id==	11201108
replace 	party_age=	.c	 if partyelec_id==	11201110
replace 	party_age=	2000	 if partyelec_id==	12200901
replace 	party_age=	1916	 if partyelec_id==	12200902
replace 	party_age=	1929	 if partyelec_id==	12200903
replace 	party_age=	1998	 if partyelec_id==	12200904
replace 	party_age=	1999	 if partyelec_id==	12200905
replace 	party_age=	2009	 if partyelec_id==	12200906
replace 	party_age=	1988	 if partyelec_id==	13201001
replace 	party_age=	1943	 if partyelec_id==	13201002
replace 	party_age=	1989	 if partyelec_id==	13201003
replace 	party_age=	2003	 if partyelec_id==	13201004
replace 	party_age=	2009	 if partyelec_id==	13201005
replace 	party_age=	.c	 if partyelec_id==	13201020
replace 	party_age=	.c	 if partyelec_id==	13201097
replace 	party_age=	1888	 if partyelec_id==	14200801
replace 	party_age=	1945	 if partyelec_id==	14200802
replace 	party_age=	1986	 if partyelec_id==	14200803
replace 	party_age=	1955	 if partyelec_id==	14200804
replace 	party_age=	2005	 if partyelec_id==	14200805
replace 	party_age=	2008	 if partyelec_id==	14200806
replace 	party_age=	2005	 if partyelec_id==	14200807
replace 	party_age=	1918	 if partyelec_id==	14200808
replace 	party_age=	1993	 if partyelec_id==	14200809
replace 	party_age=	2008	 if partyelec_id==	14200810
replace 	party_age=	2008	 if partyelec_id==	14200811
replace 	party_age=	.c	 if partyelec_id==	14200814
replace 	party_age=	1913	 if partyelec_id==	15201001
replace 	party_age=	2005	 if partyelec_id==	15201002
replace 	party_age=	1902	 if partyelec_id==	15201003
replace 	party_age=	1964	 if partyelec_id==	15201004
replace 	party_age=	1981	 if partyelec_id==	15201005
replace 	party_age=	1904	 if partyelec_id==	15201006
replace 	party_age=	1989	 if partyelec_id==	15201007
replace 	party_age=	1988	 if partyelec_id==	15201008
replace 	party_age=	1917	 if partyelec_id==	15201009
replace 	party_age=	1989	 if partyelec_id==	16201101
replace 	party_age=	1959	 if partyelec_id==	16201102
replace 	party_age=	1871	 if partyelec_id==	16201103
replace 	party_age=	1905	 if partyelec_id==	16201104
replace 	party_age=	1970	 if partyelec_id==	16201105
replace 	party_age=	2007	 if partyelec_id==	16201106
replace 	party_age=	1870	 if partyelec_id==	16201107
replace 	party_age=	1870	 if partyelec_id==	16201108
replace 	party_age=	1995	 if partyelec_id==	16201109
replace 	party_age=	2010	 if partyelec_id==	17201204
replace 	party_age=	2011	 if partyelec_id==	17201205
replace 	party_age=	2007	 if partyelec_id==	17201206
replace 	party_age=	1989	 if partyelec_id==	17201207
replace 	party_age=	2004	 if partyelec_id==	17201208
replace 	party_age=	2012	 if partyelec_id==	17201209
replace 	party_age=	1989	 if partyelec_id==	17201210
replace 	party_age=	2011	 if partyelec_id==	17201211
replace 	party_age=	1990	 if partyelec_id==	18200601
replace 	party_age=	1990	 if partyelec_id==	18200602
replace 	party_age=	1990	 if partyelec_id==	18200603
replace 	party_age=	1991	 if partyelec_id==	18200604
replace 	party_age=	1989	 if partyelec_id==	18200605
replace 	party_age=	1961	 if partyelec_id==	19200901
replace 	party_age=	1887	 if partyelec_id==	19200902
replace 	party_age=	1920	 if partyelec_id==	19200903
replace 	party_age=	1933	 if partyelec_id==	19200904
replace 	party_age=	1884	 if partyelec_id==	19200905
replace 	party_age=	1884	 if partyelec_id==	19200906
replace 	party_age=	1973	 if partyelec_id==	19200907
replace 	party_age=	2012	 if partyelec_id==	21201301
replace 	party_age=	2012	 if partyelec_id==	21201302
replace 	party_age=	1994	 if partyelec_id==	21201303
replace 	party_age=	1989	 if partyelec_id==	21201304
replace 	party_age=	2009	 if partyelec_id==	21201305
replace 	party_age=	2007	 if partyelec_id==	21201306
replace 	party_age=	2012	 if partyelec_id==	21201307
replace 	party_age=	2012	 if partyelec_id==	21201308
replace 	party_age=	2009	 if partyelec_id==	21201309
replace 	party_age=	1945	 if partyelec_id==	21201310
replace 	party_age=	2002	 if partyelec_id==	21201311
replace 	party_age=	1880	 if partyelec_id==	22201301
replace 	party_age=	1921	 if partyelec_id==	22201302
replace 	party_age=	1989	 if partyelec_id==	22201303
replace 	party_age=	.c	 if partyelec_id==	22201320
replace 	party_age=	1900	 if partyelec_id==	23201001
replace 	party_age=	1841	 if partyelec_id==	23201002
replace 	party_age=	1988	 if partyelec_id==	23201003
replace 	party_age=	1993	 if partyelec_id==	23201004
replace 	party_age=	1990	 if partyelec_id==	23201005
replace 	party_age=	1934	 if partyelec_id==	23201006
replace 	party_age=	1925	 if partyelec_id==	23201007
replace 	party_age=	1982	 if partyelec_id==	23201008
replace 	party_age=	2002	 if partyelec_id==	23201009
replace 	party_age=	2010	 if partyelec_id==	23201010
replace 	party_age=	1990	 if partyelec_id==	23201011
replace 	party_age=	.c	 if partyelec_id==	23201020
replace 	party_age=	.c	 if partyelec_id==	23201097

label variable party_age "Founding year"


gen survey_year = 	.c		
replace survey_year =	2007	 if partyelec_id==	1200701
replace survey_year =	2007	 if partyelec_id==	1200702
replace survey_year =	2007	 if partyelec_id==	1200703
replace survey_year =	2007	 if partyelec_id==	1200704
replace survey_year =	2007	 if partyelec_id==	1200705
replace survey_year =	2007	 if partyelec_id==	1200706
replace survey_year =	2007	 if partyelec_id==	1200707
replace survey_year =	2007	 if partyelec_id==	1200708
replace survey_year =	2010	 if partyelec_id==	1201001
replace survey_year =	2010	 if partyelec_id==	1201002
replace survey_year =	2010	 if partyelec_id==	1201003
replace survey_year =	2007	 if partyelec_id==	2200701
replace survey_year =	2007	 if partyelec_id==	2200702
replace survey_year =	2007	 if partyelec_id==	2200703
replace survey_year =	2007	 if partyelec_id==	2200704
replace survey_year =	2007	 if partyelec_id==	2200705
replace survey_year =	2007	 if partyelec_id==	2200706
replace survey_year =	2007	 if partyelec_id==	2200707
replace survey_year =	2007	 if partyelec_id==	2200708
replace survey_year =	2007	 if partyelec_id==	2200709
replace survey_year =	2007	 if partyelec_id==	2200710
replace survey_year =	2007	 if partyelec_id==	2200711
replace survey_year =	2007	 if partyelec_id==	2200712
replace survey_year =	2007	 if partyelec_id==	2200713
replace survey_year =	2007	 if partyelec_id==	2200714
replace survey_year =	2007	 if partyelec_id==	2200715
replace survey_year =	2007	 if partyelec_id==	2200716
replace survey_year =	2007	 if partyelec_id==	2200720
replace survey_year =	2011	 if partyelec_id==	2201101
replace survey_year =	2011	 if partyelec_id==	2201102
replace survey_year =	2011	 if partyelec_id==	2201103
replace survey_year =	2011	 if partyelec_id==	2201104
replace survey_year =	2011	 if partyelec_id==	2201107
replace survey_year =	2011	 if partyelec_id==	2201108
replace survey_year =	2011	 if partyelec_id==	2201109
replace survey_year =	2011	 if partyelec_id==	2201110
replace survey_year =	2011	 if partyelec_id==	2201111
replace survey_year =	2011	 if partyelec_id==	2201112
replace survey_year =	2011	 if partyelec_id==	2201113
replace survey_year =	2011	 if partyelec_id==	2201115
replace survey_year =	2011	 if partyelec_id==	2201116
replace survey_year =	2011	 if partyelec_id==	2201118
replace survey_year =	2011	 if partyelec_id==	2201119
replace survey_year =	2011	 if partyelec_id==	2201120
replace survey_year =	2005	 if partyelec_id==	3200501
replace survey_year =	2005	 if partyelec_id==	3200502
replace survey_year =	2005	 if partyelec_id==	3200504
replace survey_year =	2005	 if partyelec_id==	3200505
replace survey_year =	2005	 if partyelec_id==	3200506
replace survey_year =	2005	 if partyelec_id==	3200507
replace survey_year =	2005	 if partyelec_id==	3200520
replace survey_year =	2005	 if partyelec_id==	3200597
replace survey_year =	2005	 if partyelec_id==	3200901
replace survey_year =	2009	 if partyelec_id==	3200902
replace survey_year =	2009	 if partyelec_id==	3200904
replace survey_year =	2009	 if partyelec_id==	3200905
replace survey_year =	2009	 if partyelec_id==	3200906
replace survey_year =	2009	 if partyelec_id==	3200920
replace survey_year =	2009	 if partyelec_id==	3200997
replace survey_year =	2007	 if partyelec_id==	4200701
replace survey_year =	2007	 if partyelec_id==	4200702
replace survey_year =	2007	 if partyelec_id==	4200703
replace survey_year =	2007	 if partyelec_id==	4200704
replace survey_year =	2007	 if partyelec_id==	4200705
replace survey_year =	2007	 if partyelec_id==	4200706
replace survey_year =	2007	 if partyelec_id==	4200707
replace survey_year =	2007	 if partyelec_id==	5200701
replace survey_year =	2007	 if partyelec_id==	5200702
replace survey_year =	2009	 if partyelec_id==	5200901
replace survey_year =	2009	 if partyelec_id==	5200902
replace survey_year =	2012	 if partyelec_id==	5201201
replace survey_year =	2012	 if partyelec_id==	5201202
replace survey_year =	2012	 if partyelec_id==	5201203
replace survey_year =	2012	 if partyelec_id==	5201204
replace survey_year =	2012	 if partyelec_id==	5201205
replace survey_year =	2012	 if partyelec_id==	5201206
replace survey_year =	2011	 if partyelec_id==	6201101
replace survey_year =	2011	 if partyelec_id==	6201102
replace survey_year =	2011	 if partyelec_id==	6201103
replace survey_year =	2011	 if partyelec_id==	6201104
replace survey_year =	2011	 if partyelec_id==	6201105
replace survey_year =	2011	 if partyelec_id==	6201106
replace survey_year =	2011	 if partyelec_id==	6201107
replace survey_year =	2011	 if partyelec_id==	6201108
replace survey_year =	2011	 if partyelec_id==	6201109
replace survey_year =	2011	 if partyelec_id==	6201110
replace survey_year =	2011	 if partyelec_id==	6201111
replace survey_year =	2011	 if partyelec_id==	6201112
replace survey_year =	2011	 if partyelec_id==	6201113
replace survey_year =	2011	 if partyelec_id==	6201114
replace survey_year =	2011	 if partyelec_id==	6201115
replace survey_year =	2011	 if partyelec_id==	6201116
replace survey_year =	2011	 if partyelec_id==	6201117
replace survey_year =	2011	 if partyelec_id==	6201120
replace survey_year =	2007	 if partyelec_id==	7200701
replace survey_year =	2007	 if partyelec_id==	7200702
replace survey_year =	2007	 if partyelec_id==	7200703
replace survey_year =	2007	 if partyelec_id==	7200704
replace survey_year =	2007	 if partyelec_id==	7200705
replace survey_year =	2007	 if partyelec_id==	7200711
replace survey_year =	2007	 if partyelec_id==	7200712
replace survey_year =	2007	 if partyelec_id==	7200713
replace survey_year =	2007	 if partyelec_id==	7200715
replace survey_year =	2007	 if partyelec_id==	7200716
replace survey_year =	2007	 if partyelec_id==	7200717
replace survey_year =	2007	 if partyelec_id==	7200718
replace survey_year =	2010	 if partyelec_id==	7201001
replace survey_year =	2010	 if partyelec_id==	7201002
replace survey_year =	2010	 if partyelec_id==	7201003
replace survey_year =	2010	 if partyelec_id==	7201004
replace survey_year =	2010	 if partyelec_id==	7201011
replace survey_year =	2010	 if partyelec_id==	7201012
replace survey_year =	2010	 if partyelec_id==	7201013
replace survey_year =	2010	 if partyelec_id==	7201015
replace survey_year =	2010	 if partyelec_id==	7201016
replace survey_year =	2010	 if partyelec_id==	7201017
replace survey_year =	2010	 if partyelec_id==	7201018
replace survey_year =	2010	 if partyelec_id==	7201019
replace survey_year =	2006	 if partyelec_id==	8200601
replace survey_year =	2006	 if partyelec_id==	8200602
replace survey_year =	2006	 if partyelec_id==	8200603
replace survey_year =	2006	 if partyelec_id==	8200604
replace survey_year =	2006	 if partyelec_id==	8200606
replace survey_year =	2006	 if partyelec_id==	8200607
replace survey_year =	2006	 if partyelec_id==	8200608
replace survey_year =	2006	 if partyelec_id==	8200609
replace survey_year =	2006	 if partyelec_id==	8200610
replace survey_year =	2009	 if partyelec_id==	10200901
replace survey_year =	2009	 if partyelec_id==	10200902
replace survey_year =	2009	 if partyelec_id==	10200903
replace survey_year =	2009	 if partyelec_id==	10200904
replace survey_year =	2009	 if partyelec_id==	10200905
replace survey_year =	2011	 if partyelec_id==	10201101
replace survey_year =	2011	 if partyelec_id==	10201102
replace survey_year =	2011	 if partyelec_id==	10201103
replace survey_year =	2011	 if partyelec_id==	10201105
replace survey_year =	2011	 if partyelec_id==	10201106
replace survey_year =	2011	 if partyelec_id==	11201102
replace survey_year =	2011	 if partyelec_id==	11201103
replace survey_year =	2011	 if partyelec_id==	11201104
replace survey_year =	2011	 if partyelec_id==	11201105
replace survey_year =	2011	 if partyelec_id==	11201106
replace survey_year =	2011	 if partyelec_id==	11201107
replace survey_year =	2011	 if partyelec_id==	11201108
replace survey_year =	2011	 if partyelec_id==	11201110
replace survey_year =	2009	 if partyelec_id==	12200901
replace survey_year =	2009	 if partyelec_id==	12200902
replace survey_year =	2009	 if partyelec_id==	12200903
replace survey_year =	2009	 if partyelec_id==	12200904
replace survey_year =	2009	 if partyelec_id==	12200905
replace survey_year =	2009	 if partyelec_id==	12200906
replace survey_year =	2010	 if partyelec_id==	13201001
replace survey_year =	2010	 if partyelec_id==	13201002
replace survey_year =	2010	 if partyelec_id==	13201003
replace survey_year =	2010	 if partyelec_id==	13201004
replace survey_year =	2010	 if partyelec_id==	13201005
replace survey_year =	2010	 if partyelec_id==	13201020
replace survey_year =	2010	 if partyelec_id==	13201097
replace survey_year =	2008	 if partyelec_id==	14200801
replace survey_year =	2008	 if partyelec_id==	14200802
replace survey_year =	2008	 if partyelec_id==	14200803
replace survey_year =	2008	 if partyelec_id==	14200804
replace survey_year =	2008	 if partyelec_id==	14200805
replace survey_year =	2008	 if partyelec_id==	14200806
replace survey_year =	2008	 if partyelec_id==	14200807
replace survey_year =	2008	 if partyelec_id==	14200808
replace survey_year =	2008	 if partyelec_id==	14200809
replace survey_year =	2008	 if partyelec_id==	14200810
replace survey_year =	2008	 if partyelec_id==	14200811
replace survey_year =	2008	 if partyelec_id==	14200814
replace survey_year =	2010	 if partyelec_id==	15201001
replace survey_year =	2010	 if partyelec_id==	15201002
replace survey_year =	2010	 if partyelec_id==	15201003
replace survey_year =	2010	 if partyelec_id==	15201004
replace survey_year =	2010	 if partyelec_id==	15201005
replace survey_year =	2010	 if partyelec_id==	15201006
replace survey_year =	2010	 if partyelec_id==	15201007
replace survey_year =	2010	 if partyelec_id==	15201008
replace survey_year =	2010	 if partyelec_id==	15201009
replace survey_year =	2011	 if partyelec_id==	16201101
replace survey_year =	2011	 if partyelec_id==	16201102
replace survey_year =	2011	 if partyelec_id==	16201103
replace survey_year =	2011	 if partyelec_id==	16201104
replace survey_year =	2011	 if partyelec_id==	16201105
replace survey_year =	2011	 if partyelec_id==	16201106
replace survey_year =	2011	 if partyelec_id==	16201107
replace survey_year =	2011	 if partyelec_id==	16201108
replace survey_year =	2011	 if partyelec_id==	16201109
replace survey_year =	2012	 if partyelec_id==	17201204
replace survey_year =	2012	 if partyelec_id==	17201205
replace survey_year =	2012	 if partyelec_id==	17201206
replace survey_year =	2012	 if partyelec_id==	17201207
replace survey_year =	2012	 if partyelec_id==	17201208
replace survey_year =	2012	 if partyelec_id==	17201209
replace survey_year =	2012	 if partyelec_id==	17201210
replace survey_year =	2012	 if partyelec_id==	17201211
replace survey_year =	2006	 if partyelec_id==	18200601
replace survey_year =	2006	 if partyelec_id==	18200602
replace survey_year =	2006	 if partyelec_id==	18200603
replace survey_year =	2006	 if partyelec_id==	18200604
replace survey_year =	2006	 if partyelec_id==	18200605
replace survey_year =	2009	 if partyelec_id==	19200901
replace survey_year =	2009	 if partyelec_id==	19200902
replace survey_year =	2009	 if partyelec_id==	19200903
replace survey_year =	2009	 if partyelec_id==	19200904
replace survey_year =	2009	 if partyelec_id==	19200905
replace survey_year =	2009	 if partyelec_id==	19200906
replace survey_year =	2009	 if partyelec_id==	19200907
replace survey_year =	2013	 if partyelec_id==	21201301
replace survey_year =	2013	 if partyelec_id==	21201302
replace survey_year =	2013	 if partyelec_id==	21201303
replace survey_year =	2013	 if partyelec_id==	21201304
replace survey_year =	2013	 if partyelec_id==	21201305
replace survey_year =	2013	 if partyelec_id==	21201306
replace survey_year =	2013	 if partyelec_id==	21201307
replace survey_year =	2013	 if partyelec_id==	21201308
replace survey_year =	2013	 if partyelec_id==	21201309
replace survey_year =	2013	 if partyelec_id==	21201310
replace survey_year =	2013	 if partyelec_id==	21201311
replace survey_year =	2013	 if partyelec_id==	22201301
replace survey_year =	2013	 if partyelec_id==	22201302
replace survey_year =	2013	 if partyelec_id==	22201303
replace survey_year =	2013	 if partyelec_id==	22201320
replace survey_year =	2010	 if partyelec_id==	23201001
replace survey_year =	2010	 if partyelec_id==	23201002
replace survey_year =	2010	 if partyelec_id==	23201003
replace survey_year =	2010	 if partyelec_id==	23201004
replace survey_year =	2010	 if partyelec_id==	23201005
replace survey_year =	2010	 if partyelec_id==	23201006
replace survey_year =	2010	 if partyelec_id==	23201007
replace survey_year =	2010	 if partyelec_id==	23201008
replace survey_year =	2010	 if partyelec_id==	23201009
replace survey_year =	2010	 if partyelec_id==	23201010
replace survey_year =	2010	 if partyelec_id==	23201011
replace survey_year =	2010	 if partyelec_id==	23201020
replace survey_year =	2010	 if partyelec_id==	23201097

label variable survey_year "Year of CCS survey"


gen wiki_dummy=	.c		
replace wiki_dummy=	0	 if partyelec_id==	1200701
replace wiki_dummy=	0	 if partyelec_id==	1200702
replace wiki_dummy=	0	 if partyelec_id==	1200703
replace wiki_dummy=	0	 if partyelec_id==	1200704
replace wiki_dummy=	0	 if partyelec_id==	1200705
replace wiki_dummy=	1	 if partyelec_id==	1200706
replace wiki_dummy=	1	 if partyelec_id==	1200707
replace wiki_dummy=	1	 if partyelec_id==	1200708
replace wiki_dummy=	0	 if partyelec_id==	1201001
replace wiki_dummy=	0	 if partyelec_id==	1201002
replace wiki_dummy=	0	 if partyelec_id==	1201003
replace wiki_dummy=	0	 if partyelec_id==	2200701
replace wiki_dummy=	0	 if partyelec_id==	2200702
replace wiki_dummy=	0	 if partyelec_id==	2200703
replace wiki_dummy=	0	 if partyelec_id==	2200704
replace wiki_dummy=	0	 if partyelec_id==	2200705
replace wiki_dummy=	1	 if partyelec_id==	2200706
replace wiki_dummy=	1	 if partyelec_id==	2200707
replace wiki_dummy=	1	 if partyelec_id==	2200708
replace wiki_dummy=	1	 if partyelec_id==	2200709
replace wiki_dummy=	1	 if partyelec_id==	2200710
replace wiki_dummy=	1	 if partyelec_id==	2200711
replace wiki_dummy=	1	 if partyelec_id==	2200712
replace wiki_dummy=	1	 if partyelec_id==	2200713
replace wiki_dummy=	1	 if partyelec_id==	2200714
replace wiki_dummy=	1	 if partyelec_id==	2200715
replace wiki_dummy=	1	 if partyelec_id==	2200716
replace wiki_dummy=	.c	 if partyelec_id==	2200720
replace wiki_dummy=	0	 if partyelec_id==	2201101
replace wiki_dummy=	0	 if partyelec_id==	2201102
replace wiki_dummy=	0	 if partyelec_id==	2201103
replace wiki_dummy=	0	 if partyelec_id==	2201104
replace wiki_dummy=	1	 if partyelec_id==	2201107
replace wiki_dummy=	1	 if partyelec_id==	2201108
replace wiki_dummy=	1	 if partyelec_id==	2201109
replace wiki_dummy=	1	 if partyelec_id==	2201110
replace wiki_dummy=	1	 if partyelec_id==	2201111
replace wiki_dummy=	.c	 if partyelec_id==	2201112
replace wiki_dummy=	0	 if partyelec_id==	2201113
replace wiki_dummy=	1	 if partyelec_id==	2201115
replace wiki_dummy=	1	 if partyelec_id==	2201116
replace wiki_dummy=	1	 if partyelec_id==	2201118
replace wiki_dummy=	1	 if partyelec_id==	2201119
replace wiki_dummy=	.c	 if partyelec_id==	2201120
replace wiki_dummy=	0	 if partyelec_id==	3200501
replace wiki_dummy=	0	 if partyelec_id==	3200502
replace wiki_dummy=	0	 if partyelec_id==	3200504
replace wiki_dummy=	0	 if partyelec_id==	3200505
replace wiki_dummy=	0	 if partyelec_id==	3200506
replace wiki_dummy=	1	 if partyelec_id==	3200507
replace wiki_dummy=	.c	 if partyelec_id==	3200520
replace wiki_dummy=	.c	 if partyelec_id==	3200597
replace wiki_dummy=	0	 if partyelec_id==	3200901
replace wiki_dummy=	0	 if partyelec_id==	3200902
replace wiki_dummy=	0	 if partyelec_id==	3200904
replace wiki_dummy=	0	 if partyelec_id==	3200905
replace wiki_dummy=	0	 if partyelec_id==	3200906
replace wiki_dummy=	.c	 if partyelec_id==	3200920
replace wiki_dummy=	.c	 if partyelec_id==	3200997
replace wiki_dummy=	0	 if partyelec_id==	4200701
replace wiki_dummy=	0	 if partyelec_id==	4200702
replace wiki_dummy=	0	 if partyelec_id==	4200703
replace wiki_dummy=	0	 if partyelec_id==	4200704
replace wiki_dummy=	0	 if partyelec_id==	4200705
replace wiki_dummy=	0	 if partyelec_id==	4200706
replace wiki_dummy=	.c	 if partyelec_id==	4200707
replace wiki_dummy=	1	 if partyelec_id==	5200701
replace wiki_dummy=	1	 if partyelec_id==	5200702
replace wiki_dummy=	1	 if partyelec_id==	5200901
replace wiki_dummy=	1	 if partyelec_id==	5200902
replace wiki_dummy=	1	 if partyelec_id==	5201201
replace wiki_dummy=	1	 if partyelec_id==	5201202
replace wiki_dummy=	1	 if partyelec_id==	5201203
replace wiki_dummy=	1	 if partyelec_id==	5201204
replace wiki_dummy=	1	 if partyelec_id==	5201205
replace wiki_dummy=	1	 if partyelec_id==	5201206
replace wiki_dummy=	0	 if partyelec_id==	6201101
replace wiki_dummy=	0	 if partyelec_id==	6201102
replace wiki_dummy=	1	 if partyelec_id==	6201103
replace wiki_dummy=	0	 if partyelec_id==	6201104
replace wiki_dummy=	0	 if partyelec_id==	6201105
replace wiki_dummy=	0	 if partyelec_id==	6201106
replace wiki_dummy=	0	 if partyelec_id==	6201107
replace wiki_dummy=	0	 if partyelec_id==	6201108
replace wiki_dummy=	1	 if partyelec_id==	6201109
replace wiki_dummy=	1	 if partyelec_id==	6201110
replace wiki_dummy=	1	 if partyelec_id==	6201111
replace wiki_dummy=	1	 if partyelec_id==	6201112
replace wiki_dummy=	1	 if partyelec_id==	6201113
replace wiki_dummy=	1	 if partyelec_id==	6201114
replace wiki_dummy=	1	 if partyelec_id==	6201115
replace wiki_dummy=	1	 if partyelec_id==	6201116
replace wiki_dummy=	1	 if partyelec_id==	6201117
replace wiki_dummy=	.c	 if partyelec_id==	6201120
replace wiki_dummy=	0	 if partyelec_id==	7200701
replace wiki_dummy=	0	 if partyelec_id==	7200702
replace wiki_dummy=	0	 if partyelec_id==	7200703
replace wiki_dummy=	0	 if partyelec_id==	7200704
replace wiki_dummy=	1	 if partyelec_id==	7200705
replace wiki_dummy=	0	 if partyelec_id==	7200711
replace wiki_dummy=	0	 if partyelec_id==	7200712
replace wiki_dummy=	0	 if partyelec_id==	7200713
replace wiki_dummy=	0	 if partyelec_id==	7200715
replace wiki_dummy=	0	 if partyelec_id==	7200716
replace wiki_dummy=	1	 if partyelec_id==	7200717
replace wiki_dummy=	1	 if partyelec_id==	7200718
replace wiki_dummy=	0	 if partyelec_id==	7201001
replace wiki_dummy=	0	 if partyelec_id==	7201002
replace wiki_dummy=	0	 if partyelec_id==	7201003
replace wiki_dummy=	0	 if partyelec_id==	7201004
replace wiki_dummy=	0	 if partyelec_id==	7201011
replace wiki_dummy=	0	 if partyelec_id==	7201012
replace wiki_dummy=	0	 if partyelec_id==	7201013
replace wiki_dummy=	0	 if partyelec_id==	7201015
replace wiki_dummy=	0	 if partyelec_id==	7201016
replace wiki_dummy=	1	 if partyelec_id==	7201017
replace wiki_dummy=	1	 if partyelec_id==	7201018
replace wiki_dummy=	1	 if partyelec_id==	7201019
replace wiki_dummy=	0	 if partyelec_id==	8200601
replace wiki_dummy=	0	 if partyelec_id==	8200602
replace wiki_dummy=	0	 if partyelec_id==	8200603
replace wiki_dummy=	0	 if partyelec_id==	8200604
replace wiki_dummy=	0	 if partyelec_id==	8200606
replace wiki_dummy=	0	 if partyelec_id==	8200607
replace wiki_dummy=	0	 if partyelec_id==	8200608
replace wiki_dummy=	0	 if partyelec_id==	8200609
replace wiki_dummy=	0	 if partyelec_id==	8200610
replace wiki_dummy=	1	 if partyelec_id==	10200901
replace wiki_dummy=	1	 if partyelec_id==	10200902
replace wiki_dummy=	1	 if partyelec_id==	10200903
replace wiki_dummy=	1	 if partyelec_id==	10200904
replace wiki_dummy=	1	 if partyelec_id==	10200905
replace wiki_dummy=	1	 if partyelec_id==	10201101
replace wiki_dummy=	1	 if partyelec_id==	10201102
replace wiki_dummy=	1	 if partyelec_id==	10201103
replace wiki_dummy=	1	 if partyelec_id==	10201105
replace wiki_dummy=	1	 if partyelec_id==	10201106
replace wiki_dummy=	1	 if partyelec_id==	11201102
replace wiki_dummy=	1	 if partyelec_id==	11201103
replace wiki_dummy=	1	 if partyelec_id==	11201104
replace wiki_dummy=	1	 if partyelec_id==	11201105
replace wiki_dummy=	1	 if partyelec_id==	11201106
replace wiki_dummy=	1	 if partyelec_id==	11201107
replace wiki_dummy=	1	 if partyelec_id==	11201108
replace wiki_dummy=	.c	 if partyelec_id==	11201110
replace wiki_dummy=	0	 if partyelec_id==	12200901
replace wiki_dummy=	0	 if partyelec_id==	12200902
replace wiki_dummy=	0	 if partyelec_id==	12200903
replace wiki_dummy=	0	 if partyelec_id==	12200904
replace wiki_dummy=	0	 if partyelec_id==	12200905
replace wiki_dummy=	1	 if partyelec_id==	12200906
replace wiki_dummy=	0	 if partyelec_id==	13201001
replace wiki_dummy=	1	 if partyelec_id==	13201002
replace wiki_dummy=	0	 if partyelec_id==	13201003
replace wiki_dummy=	1	 if partyelec_id==	13201004
replace wiki_dummy=	1	 if partyelec_id==	13201005
replace wiki_dummy=	.c	 if partyelec_id==	13201020
replace wiki_dummy=	.c	 if partyelec_id==	13201097
replace wiki_dummy=	1	 if partyelec_id==	14200801
replace wiki_dummy=	1	 if partyelec_id==	14200802
replace wiki_dummy=	1	 if partyelec_id==	14200803
replace wiki_dummy=	1	 if partyelec_id==	14200804
replace wiki_dummy=	1	 if partyelec_id==	14200805
replace wiki_dummy=	1	 if partyelec_id==	14200806
replace wiki_dummy=	1	 if partyelec_id==	14200807
replace wiki_dummy=	1	 if partyelec_id==	14200808
replace wiki_dummy=	1	 if partyelec_id==	14200809
replace wiki_dummy=	1	 if partyelec_id==	14200810
replace wiki_dummy=	1	 if partyelec_id==	14200811
replace wiki_dummy=	.c	 if partyelec_id==	14200814
replace wiki_dummy=	0	 if partyelec_id==	15201001
replace wiki_dummy=	1	 if partyelec_id==	15201002
replace wiki_dummy=	0	 if partyelec_id==	15201003
replace wiki_dummy=	0	 if partyelec_id==	15201004
replace wiki_dummy=	0	 if partyelec_id==	15201005
replace wiki_dummy=	0	 if partyelec_id==	15201006
replace wiki_dummy=	0	 if partyelec_id==	15201007
replace wiki_dummy=	1	 if partyelec_id==	15201008
replace wiki_dummy=	0	 if partyelec_id==	15201009
replace wiki_dummy=	0	 if partyelec_id==	16201101
replace wiki_dummy=	0	 if partyelec_id==	16201102
replace wiki_dummy=	0	 if partyelec_id==	16201103
replace wiki_dummy=	0	 if partyelec_id==	16201104
replace wiki_dummy=	0	 if partyelec_id==	16201105
replace wiki_dummy=	1	 if partyelec_id==	16201106
replace wiki_dummy=	0	 if partyelec_id==	16201107
replace wiki_dummy=	0	 if partyelec_id==	16201108
replace wiki_dummy=	0	 if partyelec_id==	16201109
replace wiki_dummy=	1	 if partyelec_id==	17201204
replace wiki_dummy=	1	 if partyelec_id==	17201205
replace wiki_dummy=	1	 if partyelec_id==	17201206
replace wiki_dummy=	0	 if partyelec_id==	17201207
replace wiki_dummy=	1	 if partyelec_id==	17201208
replace wiki_dummy=	1	 if partyelec_id==	17201209
replace wiki_dummy=	0	 if partyelec_id==	17201210
replace wiki_dummy=	1	 if partyelec_id==	17201211
replace wiki_dummy=	0	 if partyelec_id==	18200601
replace wiki_dummy=	0	 if partyelec_id==	18200602
replace wiki_dummy=	0	 if partyelec_id==	18200603
replace wiki_dummy=	0	 if partyelec_id==	18200604
replace wiki_dummy=	1	 if partyelec_id==	18200605
replace wiki_dummy=	0	 if partyelec_id==	19200901
replace wiki_dummy=	0	 if partyelec_id==	19200902
replace wiki_dummy=	0	 if partyelec_id==	19200903
replace wiki_dummy=	0	 if partyelec_id==	19200904
replace wiki_dummy=	0	 if partyelec_id==	19200905
replace wiki_dummy=	0	 if partyelec_id==	19200906
replace wiki_dummy=	0	 if partyelec_id==	19200907
replace wiki_dummy=	1	 if partyelec_id==	21201301
replace wiki_dummy=	1	 if partyelec_id==	21201302
replace wiki_dummy=	1	 if partyelec_id==	21201303
replace wiki_dummy=	1	 if partyelec_id==	21201304
replace wiki_dummy=	1	 if partyelec_id==	21201305
replace wiki_dummy=	1	 if partyelec_id==	21201306
replace wiki_dummy=	1	 if partyelec_id==	21201307
replace wiki_dummy=	1	 if partyelec_id==	21201308
replace wiki_dummy=	1	 if partyelec_id==	21201309
replace wiki_dummy=	1	 if partyelec_id==	21201310
replace wiki_dummy=	1	 if partyelec_id==	21201311
replace wiki_dummy=	1	 if partyelec_id==	22201301
replace wiki_dummy=	1	 if partyelec_id==	22201302
replace wiki_dummy=	1	 if partyelec_id==	22201303
replace wiki_dummy=	.c	 if partyelec_id==	22201320
replace wiki_dummy=	0	 if partyelec_id==	23201001
replace wiki_dummy=	0	 if partyelec_id==	23201002
replace wiki_dummy=	0	 if partyelec_id==	23201003
replace wiki_dummy=	1	 if partyelec_id==	23201004
replace wiki_dummy=	1	 if partyelec_id==	23201005
replace wiki_dummy=	0	 if partyelec_id==	23201006
replace wiki_dummy=	0	 if partyelec_id==	23201007
replace wiki_dummy=	1	 if partyelec_id==	23201008
replace wiki_dummy=	1	 if partyelec_id==	23201009
replace wiki_dummy=	1	 if partyelec_id==	23201010
replace wiki_dummy=	1	 if partyelec_id==	23201011
replace wiki_dummy=	.c	 if partyelec_id==	23201020
replace wiki_dummy=	.c	 if partyelec_id==	23201097


gen party_age2 = survey_year - party_age
label variable party_age2 "Party age (in years)"

gen party_age2_log=ln(party_age2+1)
label variable party_age2 "Party age (log)"
